package cn.le.route;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 项目名  spring-boot
 * Created by lansp
 * Created at 2018/6/1
 * 描述:
 */
@Configuration
public class RouteConfig {

	@Bean
	public Queue queueMsgA(){
		return new Queue("msgA");
	}

	@Bean
	public Queue queueMsgB(){
		return new Queue("msgB");
	}

	@Bean
	public DirectExchange directExchange(){
		return new DirectExchange("directExchange");
	}

	@Bean
	public Binding directExchangeA(DirectExchange exchange){
		return BindingBuilder.bind(queueMsgA()).to(exchange).with("msgA");
	}
	@Bean
	public Binding directExchangeB(DirectExchange exchange){
		return BindingBuilder.bind(queueMsgB()).to(exchange).with("msgB");
	}


}
